<?php
require_once 'Zend/Db/Table/Abstract.php';

class Default_Model_DbTable_DictionaryTable extends Zend_Db_Table_Abstract {
	/**
	 * The default table name
	 */
	protected $_name = 'dict_dictionary';
	
	public function enableDicts(array $dicts) {
		$this->disableAll();		
		$rows =  $this->find($dicts);
		/* @var $row Zend_Db_Table_Row */
		foreach ($rows as $row) {
			$row->enabled = true;
			$row->save();
		}
	}
	
	public function disableAll() {
		$rows =  $this->fetchAll();
		foreach ($rows as $row) {
			$row->enabled = false;
			$row->save();
		}
	}
	
}